package com.bjfu.intelligentrecognizeserver.service.impl;

import com.bjfu.intelligentrecognizeserver.mapper.CommonMapper;
import com.bjfu.intelligentrecognizeserver.pojo.entity.Kind;
import com.bjfu.intelligentrecognizeserver.pojo.entity.RecommendInfo;
import com.bjfu.intelligentrecognizeserver.service.CommonService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class CommonServiceImpl implements CommonService {
    private final CommonMapper commonMapper;
    @Override
    public List<RecommendInfo> getRecommendInfo() {
        //返回推荐表中的信息
        return commonMapper.getRecommendInfo();
    }

    @Override
    public Kind getKind(Integer jieId) {
        List<String> listMen = commonMapper.getMenByJieId(jieId);
        List<String> listGang = commonMapper.getGangByJieId(jieId);
        List<String> listMu = commonMapper.getMuByJieId(jieId);
        List<String> listKe = commonMapper.getKeByJieId(jieId);
        List<String> listShu = commonMapper.getShuByJieId(jieId);
        List<String> listCategory = commonMapper.getCategoryByJieId(jieId);

        return new Kind(
               listMen,
               listGang,
               listMu,
               listKe,
               listShu,
               listCategory
        );
    }
}
